package com.yiwu.common.enums;

import com.yiwu.common.exception.BaseExceptionInterface;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum ResponseCode implements BaseExceptionInterface {

    // ----------- 通用异常状态码 -----------
    SUCCESS(0, "响应成功" ),
    NO_LOGIN(1000,"没有登陆"),
    NO_SAVE(4100,"保存失败"),
    SYSTEM_ERROR(5000,"系统错误"),
    NO_AUTH(1234,"没有权限"),
    NO_QUERY(3255,"没有找到"),
    PARAMETER_ERROR(999,"参数错误"),
    OVER_FLOW(777,"栈溢出"),
    OUT_OF_BOUNDS(12306,"数组越界"),
    SQL_Syntax_ERROR(12306,"SQL语法错误"),
    HTTP_ERROR(1001,"HTTP请求错误"),
    RPC_ERROR(1001,"RPC调用错误"),
    NO_DATA(1001,"没有数据"),
    REDIS_FAIL(1002,"redis链接失败"),
    WEIXIN_ERROR(1003,"微信请求Token失败"),
    TOKEN_ERROR(1004,"会话失效"),

    //业务异常
    PRICE_ERROR(2001,"价格错误"),
    DESCRIPTION_ERROR(2002,"商品描述错误"),
    CATEGORY_ERROR(2003,"分类ID错误"),
    SELLER_ERROR(2004,"用户ID错误"),
    PRODUCTID_ERROR(2005,"商品ID错误"),
    UPLOAD_ERROR(2006,"上传文件失败"),
    DELETE_ERROR(2007,"当前商品已被删除"),
    AVAILABLE_ERROR(2008,"当前商品已被上架或删除"),
    SOLD_ERROR(2009,"当前商品已被下架或删除"),
    IMAGE_ERROR(2010,"图片上传失败"),
    LOGIN_ERROR(2011,"登录失败"),
    ADD_FAVORITE_ERROR(2012,"当前商品已存在"),
    DEL_FAVORITE_ERROR(2013,"当前商品已删除"),
    PSTATUS_ERROR(2014,"商品状态参数错误"),
    WS_ERROR(2015,"ws建立错误"),
    MSGTYPE_ERROR(2016,"消息类型错误"),
    SENDMSG_ERROR(2017,"发送消息失败"),
    MESSAGESAVE_ERROR(2018,"消息保存失败"),
    MQSEND_ERROR(2019,"mq发送消息失败")
    ;

    // 异常码
    private final int code;
    // 错误信息
    private final String message;

}
